import { Model } from '@/type/Model';

export default function removeModelRelationship<T extends Model>(model: T): T {
    const clonedModel = { ...model };
    Object.entries(model).forEach(([key, value]) => {
        if (typeof value === 'object') delete clonedModel[key as keyof T];
    });
    delete clonedModel.created_at;
    delete clonedModel.updated_at;
    delete clonedModel.deleted_at;
    return clonedModel;
}
